package com.company.andy.jiujiu.base;

import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

/**
 * Created by Andy on 2016/5/9.
 */
public class BaseFragment extends Fragment {

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return onCreateUI(inflater, container, savedInstanceState);
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        onBindingListener(view, savedInstanceState);
        onBindingData(view, savedInstanceState);
    }

    /*
        * 视图创建
        * */
    protected View onCreateUI(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return null;
    }

    /*
    * 绑定监听器
    * */
    protected void onBindingListener(View view, Bundle savedInstanceState) {
    }

    /*
    *数据绑定
    * */
    protected void onBindingData(View view, Bundle savedInstanceState) {
    }
}
